<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>查询</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <!--  <link href="css/index.css" rel="stylesheet" type="text/css">-->
    <link href="Content/wechat/css/woDeWangGe.css" rel="stylesheet" type="text/css">
    <link href="Content/wechat/css/woDeXinYuan_FB.css" rel="stylesheet" type="text/css">
    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--页码js-->
    <script src="Content/wechat/js/myPagination.js"></script>
    <!--页码-->
    <link href="Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
    <img src="Content/wechat/images/zxbl.png">
</header>
<div class="xinyuan">
    <div class="xinyuan_box">


        <dl class="clearfix">
            <dt>姓名</dt>
            <dd>
                <input type="text" class="text" id="name" placeholder="请输入姓名">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>身份证号</dt>
            <dd>
                <input type="text" class="text" id="idnum" placeholder="请输身份证号">
            </dd>
        </dl>

        <div class="sousuo" onclick="btnSelect()">查询</div>
    </div>
</div>

<div class="dianLiang_list" id="dianLiang_list" style="display: none">
    <div class="dianLiang_list_box">
        <h4>证件类型：<span>设分支</span></h4>
        <h4>姓名：<span>西郊</span></h4>
        <h4>身份证号：<span>25666888899</span></h4>
        <h4>状态：<span style="color: red">已办结</span></h4>
    </div>
</div>
</body>


<script>


    var isSummit = true;

    function btnSelect() {
        if ($("#name").val() == 0) {
            alert("请输入姓名");
            return false;
        }
        if ($("#idnum").val() == 0) {
            alert("请输入身份证号");
            return false;
        }
        if (!isSummit) {
            alert("正在查询，请稍后");
        } else if (isSummit) {
            isSummit = false;
            $.ajax({
                //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "/wechat/home/card/GetEntity",//url
                data: {name: $("#name").val(), idnum: $("#idnum").val()},
                success: function (result) {
                    console.log(result);//打印服务端返回的数据(调试用)
                    var json = JSON.parse(result.data);
                    if (result.code == 200 && json.total > 0) {
                        $("#dianLiang_list").show();
                        $("#dianLiang_list").empty();
                        $.each(json.rows, function (index, items) {
                            $("#dianLiang_list").append(" <div class=\"dianLiang_list_box\">\n" +
                                "            <h4>证件类型：<span>"+items.type+"</span></h4>\n" +
                                "            <h4>姓名：<span>"+items.name+"</span></h4>\n" +
                                "            <h4>身份证号：<span>"+items.idnum+"</span></h4>\n" +ispadd(items.ispass) +
                                "            <h4>备注：<span>"+items.content+"</span></h4>\n" +
                                "        </div><br>");
                        });

                        isSummit = true;
                    } else {
                        isSummit = true;
                        alert("暂无数据");
                        $("#dianLiang_list").html("");
                    }
                },
                error: function () {
                    alert("异常！");
                    isSummit = true;
                }
            });
        }
    }

    function ispadd(type) {

        if (type != null && type == '0') {
            return "<h4>状态：<span  style=\"color: red\">未通过</span></h4>";
        } else if (type != null && type == '1') {
            return "<h4>状态：<span  style=\"color: green\">\通过</span></h4>";
        } else if (type != null && type == '-1') {
            return "<h4>状态：<span  >\未审核</span></h4>";
        }
    }
</script>


</html>